<?php 
include("conn.php");
include('seguridad.php');
$pkuser='01';
$pro1=$_POST['deta1'];
$pro2=$_POST['deta2'];
$pro3=$_POST['deta3'];
$pro4=$_POST['deta4'];
$pro5=$_POST['deta5'];
$pro6=$_POST['deta6'];
$pro7=$_POST['deta7'];
$pro8=$_POST['deta8'];
/*$query ="delete from bt14situes where bt14ides='".$pkuser."'";
echo 'eliminado '.$mysqli->query($query);*/
foreach ($_REQUEST["seleccion"] as $value) {
if($value=='64'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro1');";	
		}	
if($value=='65'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro2');";	
		}
if($value=='66'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro3');";	
		}	
if($value=='67'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro4');";	
		}	
if($value=='68'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro5');";	
		}	
if($value=='69'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro6');";	
		}	
if($value=='70'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro7');";	
		}	
if($value=='71'){	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
				VALUES ('$value',
			      '$pkuser','checked','$pro8');";	
		}	
}
echo $mysqli->query($query);
}
print "<script>alert('Se inserto con exito');</script>";
print "<script>window.open('../Usuarios/index.php', '_self');</script>";
header('Location: GestionCondiciones5.php'); 
?>
